import axios from "../utils/axios";

export default {
  login(username, password) {
    return axios.post("/auth/login", {
      data: {
        username,
        password
      }
    });
  },
  register(username, password, email) {
    return axios.post("/auth/register", {
      data: {
        username,
        password,
        email
      }
    });
  },
  getDetail() {
    return axios.post("/api/auth");
  },
  getProfile() {
    return axios.get("/api/auth");
  },
  changePassword(password) {
    return axios.post("/api/user", {
      data: {
        password
      }
    });
  }
};
